Home:ALL Converter>Python: Converting JSON entry to a SQL command ( divided by columns and attributes)

Python: Converting JSON entry to a SQL command ( divided by columns and attributes)

Ask Time:2020-02-12T21:47:17         Author:Alex Martins

Json Formatter

New in Python. I am trying to convert JSON files to SQL files, but JSON file it's to complex with many entries, the structure it's like this:

['{"category": "new", "id": 1, "Name": ["Tester1"], "properties": {"host": "xxx", "type": "yyy", "device": null, "serial": "ddddd", "manufacturer": "vvvv"}}\n,']

... next entry....

I have a list, my final objective is to get something like this t then import with SQL commands:

Columns: category | id | Name | host| type | device | serial |manufacturer

Attributes:  new  | 1  | Tester1 | xxxx | yyy | null | dddd| yyyy

Any ideas to start?

Thank you.

Author:Alex Martins,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/60189822/python-converting-json-entry-to-a-sql-command-divided-by-columns-and-attribut
yy